import request from '@/utils/request'
import { getToken, setToken, removeToken } from '@/utils/auth'
export default {
  /**
   * 编写人：曲哲
   * 时间：2021-4-28
   *
   */

  //分页用户条件查询
  getUserList(current, limit, userQuery) {
    return request({
      url: `/user/pageListUsers/${current}/${limit}`,
      method: 'post',
      data: userQuery,
    })
  },

  saveUser(user) {
    return request({
      url: `/user/addUser`,
      method: 'post',
      data: user
    })
  },

  removeUserById(id) {
    return request({
      url: `/user/removeUser/${id}`,
      method: 'get',

    })
  },
  findByIdUser(id) {
    return request({
      url: `/user/findByIdUser/${id}`,
      method: 'get'
    })
  },

  updateUser(user) {
    return request({
      url: `/user/upUser`,
      method: 'post',
      data: user
    })
  },

  getDepartment(){
    return request({
      url: `/user/getDepartment`,
      method: 'post',
    })
  },
  getPosition(pid){
    return request({
    url: `/user/getPosition/${pid}`,
    method: 'post'
  })
  },
  //用户密码重置
  initPassword(id) {
    return request({
      url: `/user/initPassword/${id}`,
      method: 'get'
    })
  },


  //修改用户密码
  updatePass(lpass,rpass){
    return request({
      url: '/user/updatePassword',
      method: 'post',
      data:{
        lpass,
        rpass
      },

    })
  }


}
